package org.mspring.mlog.service.bbs.impl;

import org.mspring.mlog.entity.bbs.ForumCatalog;
import org.mspring.mlog.service.bbs.ForumCatalogService;
import org.mspring.platform.dao.hibernate.GenericDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 
 * @author Gao Youbo
 * @since 2013年8月6日
 */
@Service
@Transactional
public class ForumCatalogServiceImpl extends GenericDao<ForumCatalog, Long> implements ForumCatalogService {

    @Override
    public boolean hasForum(Long forumCatalogId) {
        // TODO Auto-generated method stub
        Long count = Long.valueOf(getHibernateTemplate().uniqueResult("select count(*) from Forum forum where forum.catalog.id = ?", forumCatalogId).toString());
        return count > 0;
    }
}
